<div class="bg-light lter b-b wrapper-md">
    <h1 class="m-n font-thin h3" translate="device.management"></h1>
</div>
<div class="wrapper-md" ng-controller="DeviceAddOrUpdateCtrl">
    <div class="panel panel-default">
        <ng-form name="AddForm" class="form-horizontal form-validation">
            <!--面板标题-->
            <div class="panel-heading font-bold" translate="{{vm.title}}"></div>
            <div class="panel-body">                
                <div class="form-group ">
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.snCode"></span>
                        </label>
                        <div class="col-lg-8">
                            <input type="text" class="form-control" name="device.number" id="deviceID"
                                   ng-model="device.number"
                                   maxlength="32" required
                                   uib-tooltip="{{'common.op.remind2' | translate}}"/>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.name"></span>
                        </label>
                        <div class="col-lg-8">
                            <input class="form-control" name="device.name" id="deviceName" maxlength="32"
                                   ng-model="device.name" required
                                   ng-pattern="app.reg.account"
                                   uib-tooltip="{{'common.op.remind1' | translate}}"/>
                        </div>
                    </div>
                </div>
                <div class="form-group ">
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.deviceType"></span>
                        </label>
                        <div class="col-lg-8">
                           <select class="input-sm form-control inline v-middle" name="device.type"
                                    ng-model="device.type" convert-to-number required>
                                <option value="4" translate="">PM10</option>                                
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.installTime"></span>
                        </label>
                        <div class="col-lg-8">
                            <input class="form-control" name="device.date" id="deviceDate" maxlength="32"
                                   ng-model="device.date" required
                                   ng-pattern="app.reg.account"
                                   uib-tooltip="{{'common.op.remind1' | translate}}"/>
                        </div>
                    </div>
                </div>
                <div class="form-group ">
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.deviceLocation"></span>
                        </label>
                        <div class="col-lg-8">
                            <select class="input-sm form-control inline v-middle" name="device.addr"
                                    ng-model="device.addr" convert-to-number required>
                                <option value="1" translate="">1区</option>
                                <option value="2" translate="">2区</option>
                                <option value="3" translate="">3区</option>
                            </select>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span translate="device.deviceStatus"></span>
                        </label>
                        <div class="col-lg-8">
                            <select class="input-sm form-control inline v-middle" name="device.status"
                                    ng-model="device.status" convert-to-number required>
                                <option value="0" translate="vs.monitorRecord.online"></option>
                                <option value="5" translate="vs.monitorRecord.offline"></option>
                                <option value="6" translate="vs.monitorRecord.fault"></option>
                            </select>
                        </div>
                    </div>
                </div>
                <!--经纬度 -->
                <div class="form-group ">
                <div class="col-sm-6">
                    <label class="col-lg-3 control-label">
                        <span class="text-danger">*</span>
                        <span translate="common.longitude"></span>
                    </label>
                    <div class="col-lg-8">
                        <div class="input-group">
                            <input type="text" name="name" class="form-control" ng-model="vm.area.longitude"
                                   id="updateArchLongitude"
                                   required
                                   placeholder="-180 ~ 180"
                                   ui-validate="{a:'$value == undefined || $value >= -180', b:'$value == undefined || $value <= 180', c: 'app.reg.checkNumber($value, 3, 6)'}"/>
                            <span class="input-group-btn">
                                     <map-select on-select="vm.location"></map-select>
                                </span>
                        </div>
                    </div>
                </div>
                <div class="col-sm-6">
                    <label class="col-md-3 control-label">
                        <span class="text-danger">*</span>
                        <span translate="common.latitude"></span>
                    </label>
                    <div class="col-md-8">
                        <div class="input-group">
                            <input type="text" name="number" class="form-control" ng-model="vm.area.latitude"
                                   id="updateArchLatitude"
                                   required
                                   placeholder="-90 ~ 90"
                                   ui-validate="{a:'$value == undefined || $value >= -90', b:'$value == undefined || $value <= 90', c: 'app.reg.checkNumber($value, 2, 6)'}"/>
                            <span class="input-group-btn">
                                     <map-select on-select="vm.location"></map-select>
                                </span>
                        </div>
                    </div>
                </div>
                </div>
				<!-- <div class="form-group ">
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span transladevicement.jingdu">经度</span>
                        </label>
                        <div class="col-lg-8" >
                            <input type="text" name="name" class="form-control" nadevicement.jingdu" id="deviceJingdu"
                                   ng-moddevicement.jingdu"
                                   maxlength="32" required
                                   uib-tooltip="{{'common.op.remind2' | translate}}"/>
                            <map-select class="input-group-addon no-padder ng-isolate-scope" on-select="vm.location"
                            		location="vm.device">
                            	<button class="btn m-b-none btn-default padder-2 ng-scope"
                            		ng-click="vm.setLocation()" translate="common.location">定位</button>
                            </map-select>
                        </div>
                    </div>
                    <div class="col-sm-6">
                        <label class="col-lg-3 control-label">
                            <span class="text-danger">*</span>
                            <span transladevicement.weidu">纬度</span>
                        </label>
                        <div class="col-lg-8">
                            <input type="text" name="" class="form-control" nadevicement.weidu" id="deviceWdu"
                                   ng-moddevicement.weidu"
                                   maxlength="32" required
                                   uib-tooltip="{{'common.op.remind2' | translate}}"/>
                        </div>
                    </div>
                </div> -->
            </div>
        <footer class="panel-footer text-right bg-light lter">
			<button type="button" class="btn btn-default" ng-click="vm.cancel()"
				translate="common.cancel">取消</button>
			<button type="button" class="btn btn-primary" ng-click="vm.save()"
				ng-disabled="roleAddForm.$invalid" translate="common.confirm">确定</button>
		</footer></ng-form>
    </div>
</div>